#pragma once

#include "Common.h"
#include "ThreadCache.h"

void* ConcurrentAlloc(size_t size)
{
    if (pTlsThreadCache == nullptr)
    {
        pTlsThreadCache = new ThreadCache;
    }
    cout << std::this_thread::get_id() << ":" << pTlsThreadCache << endl;
    return pTlsThreadCache->Allocate(size);                                                                          
}

static void ConcurrentFree(void* ptr ,size_t size)
{
    assert(pTlsThreadCache);
    pTlsThreadCache->Deallocate(ptr, size);
}